//
//  GiftIntroduceCollectionViewCell.m
//  礼物说
//
//  Created by dllo on 16/4/26.
//  Copyright © 2016年 sunzhichao. All rights reserved.
//

#import "GiftIntroduceCollectionViewCell.h"

@interface GiftIntroduceCollectionViewCell ()

@property (nonatomic, retain) UIWebView *webView;

@end

@implementation GiftIntroduceCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}
- (void)dealloc{
    
    [_model release];
    [_webView release];
    [super dealloc];
}

- (void)setModel:(GiftContentModel *)model{
    
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    [_webView loadHTMLString:_model.detail_html baseURL:[NSURL URLWithString:_model.url]];
}
- (void)createCell{
    
    self.webView = [[UIWebView alloc] init];
    [self.contentView addSubview:_webView];
    /**关闭webView滑动效果 */
    _webView.scrollView.scrollEnabled = NO;
    [_webView release];
    
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    
    _webView.frame = self.contentView.bounds;
    
}


@end
